/*
 * value.c
 *
 *  Created on: 2013-5-19
 *      Author: xkaying
 */


#include "value.h"

#include "../common/list.h"

#include <assert.h>

#include <stdlib.h>

struct _value{
		int type; //类型
		List *template;// 模板值,通常没用
		union{
				char *data;//数据
				List *vlist;
		};
};

Value *ValueInit(int type,char *value)
{
	Value *pvalue;
	pvalue=(Value*)malloc(sizeof(Value));
	pvalue->type=type;
	pvalue->data=value;
	pvalue->template=0;
	return pvalue;
}

void ValueAppend(Value *pvalue,char *variable)
{

	assert(variable);
	if(pvalue->vlist==0){
		pvalue->vlist=ListInit();
	}
	ListPush(pvalue->vlist,variable);
}
